﻿#include "sasomiaotheard.h"

sasomiaotheard::sasomiaotheard(QObject *parent) : QThread(parent)
{

}
void sasomiaotheard::run()
{

    sendercanshu * chuancanpanduan =(sendercanshu *) chuancan1;
    if(chuancanpanduan->lianbiao->shoucisaomiao ==1){
         readprocessmubiao(chuancan1);
    }else{
        //std::cout<<"22"<<std::endl;
        zaicisaomiao(chuancan1);
    }
    emit saomiaoend();
}

void sasomiaotheard::readprocessmubiao(void * chuancan1)//首次从目标进程读取值
{

    sendercanshu * chuancan =(sendercanshu *) chuancan1;

    HANDLE handleexe = OpenProcess(PROCESS_ALL_ACCESS, FALSE,chuancan->processID);


    if (handleexe == NULL) {
        std::cerr << "OpenProcess failed: " << GetLastError() << std::endl;
        return ;
    }

    MEMORY_BASIC_INFORMATION mbi;
    LPVOID p = (LPVOID)0x00010000;
    BOOL ret = FALSE;
    IsWow64Process(handleexe, &ret);//判断程序是32位还是64位
    if(ret){
        //std::cout <<32 << std::endl;
        while ((VirtualQueryEx(handleexe, p, &mbi, sizeof(mbi)))&&(p<(LPVOID)0x7FFEFFFF))
        {

            //std::cerr << chuancan->processID << std::endl;
            SIZE_T result = VirtualQueryEx(handleexe, p, &mbi, sizeof(mbi));//获取内存块的基址和大小

            //std::cout << "Base address: " << (void*)mbi.BaseAddress << ", daxiao: " << (size_t)mbi.RegionSize << std::endl;

            switch (chuancan->xuhao) {
            case 0://读取4字节
            {
                int* dataBuffer = (int*)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    //std::cout<<"shibai:"<<pid_p<<std::endl;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize/4);i++ )
                    {
                        int guize = chuancan->guize;

                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==chuancan->jiancha){
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void *)&dataBuffer[i]);
                                }
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=chuancan->jiancha)&&(dataBuffer[i]<=chuancan->jiancha2))
                               chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+4;
                    }
                }
                free(dataBuffer);
                break;
            }

            case 1://读取单字节
            {
                char* dataBuffer = (char*)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    //std::cout<<"shibai:"<<pid_p<<std::endl;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize);i++ )
                    {
                        char guize = chuancan->guize;

                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=chuancan->jiancha)&&(dataBuffer[i]<=chuancan->jiancha2))
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+1;
                    }
                }
                free(dataBuffer);
                break;
            }
            case 2://读取2字节
            {
                wchar_t* dataBuffer = (wchar_t*)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    //std::cout<<"shibai:"<<pid_p<<std::endl;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize/2);i++ )
                    {
                        char guize = chuancan->guize;

                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==chuancan->jiancha)
                               chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=chuancan->jiancha)&&(dataBuffer[i]<=chuancan->jiancha2))
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+2;
                    }
                }
                free(dataBuffer);
                break;
            }
            case 3://读取8字节
            {
                long long* dataBuffer = (long long*)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    //std::cout<<"shibai:"<<pid_p<<std::endl;
                    break;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize/8);i++ )
                    {
                        char guize = chuancan->guize;

                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==chuancan->jiancha)
                               chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=chuancan->jiancha)&&(dataBuffer[i]<=chuancan->jiancha2))
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+8;
                    }
                }
                free(dataBuffer);
                break;
            }

            case 4://读取float字节
            {
                float * dataBuffer = (float *)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    //std::cout<<"shibai:"<<pid_p<<std::endl;
                    break;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize/sizeof(float));i++ )
                    {
                        float * a = (float *)&chuancan->jiancha;
                        float * b = (float *)&chuancan->jiancha2;
                        char guize = chuancan->guize;


                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==*a)
                               {//std::cout<<dataBuffer[i]<<std::endl;
                               chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            }
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=*a)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=*a)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=*a)&&(dataBuffer[i]<=*b))
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+sizeof (float);
                    }
                }
                free(dataBuffer);
                break;
            }
            case 5://读取double类型
            {
                double* dataBuffer = (double*)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    std::cout<<"shibai:"<<pid_p<<std::endl;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize/sizeof (double));i++ )
                    {
                        char guize = chuancan->guize;
                        double * a = (double *)&chuancan->jiancha;
                        double * b = (double *)&chuancan->jiancha2;

                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==* a)
                               chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=* a)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=* a)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=* a)&&(dataBuffer[i]<=* b))
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+sizeof (double);
                    }
                }
                free(dataBuffer);
                break;
            }

            }

            p = (char*)mbi.BaseAddress + mbi.RegionSize;

        }

    }
    else{
        //std::cout << "64"<< std::endl;
        while ((VirtualQueryEx(handleexe, p, &mbi, sizeof(mbi)))&&(p<(LPVOID)0x7FFFFEFFFF))
        {

            //std::cerr << chuancan->processID << std::endl;
            SIZE_T result = VirtualQueryEx(handleexe, p, &mbi, sizeof(mbi));//获取内存块的基址和大小

            //std::cout << "Base address: " << (void*)mbi.BaseAddress << ", daxiao: " << (size_t)mbi.RegionSize << std::endl;



            switch (chuancan->xuhao) {
            case 0://读取4字节
            {
                int* dataBuffer = (int*)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    //std::cout<<"shibai:"<<pid_p<<std::endl;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize/4);i++ )
                    {
                        int guize = chuancan->guize;

                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==chuancan->jiancha){
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void *)&dataBuffer[i]);
                                }
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=chuancan->jiancha)&&(dataBuffer[i]<=chuancan->jiancha2))
                               chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+4;
                    }
                }
                free(dataBuffer);
                break;
            }

            case 1://读取单字节
            {
                char* dataBuffer = (char*)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    //std::cout<<"shibai:"<<pid_p<<std::endl;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize);i++ )
                    {
                        char guize = chuancan->guize;

                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=chuancan->jiancha)&&(dataBuffer[i]<=chuancan->jiancha2))
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+1;
                    }
                }
                free(dataBuffer);
                break;
            }
            case 2://读取2字节
            {
                wchar_t* dataBuffer = (wchar_t*)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    //std::cout<<"shibai:"<<pid_p<<std::endl;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize/2);i++ )
                    {
                        char guize = chuancan->guize;

                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==chuancan->jiancha)
                               chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=chuancan->jiancha)&&(dataBuffer[i]<=chuancan->jiancha2))
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+2;
                    }
                }
                free(dataBuffer);
                break;
            }
            case 3://读取8字节
            {
                long long* dataBuffer = (long long*)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    //std::cout<<"shibai:"<<pid_p<<std::endl;
                    break;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize/8);i++ )
                    {
                        char guize = chuancan->guize;

                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==chuancan->jiancha)
                               chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=chuancan->jiancha)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=chuancan->jiancha)&&(dataBuffer[i]<=chuancan->jiancha2))
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+8;
                    }
                }
                free(dataBuffer);
                break;
            }

            case 4://读取float字节
            {
                float * dataBuffer = (float *)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    //std::cout<<"shibai:"<<pid_p<<std::endl;
                    break;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize/sizeof(float));i++ )
                    {
                        float * a = (float *)&chuancan->jiancha;
                        float * b = (float *)&chuancan->jiancha2;
                        char guize = chuancan->guize;


                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==*a)
                               {//std::cout<<dataBuffer[i]<<std::endl;
                               chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            }
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=*a)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=*a)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=*a)&&(dataBuffer[i]<=*b))
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+sizeof (float);
                    }
                }
                free(dataBuffer);
                break;
            }
            case 5://读取double类型
            {
                double* dataBuffer = (double*)malloc(mbi.RegionSize);
                BOOL pid_bol;
                LPVOID pid_p = mbi.BaseAddress;
                pid_bol = ReadProcessMemory(handleexe, pid_p, dataBuffer, mbi.RegionSize, NULL);
                if(pid_bol==0){
                    std::cout<<"shibai:"<<pid_p<<std::endl;
                }
                else
                {
                    for (int i=0;i<(mbi.RegionSize/sizeof (double));i++ )
                    {
                        char guize = chuancan->guize;
                        double * a = (double *)&chuancan->jiancha;
                        double * b = (double *)&chuancan->jiancha2;

                        switch (guize)
                        {
                        case 0:
                        {
                            if(dataBuffer[i]==* a)
                               chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 1:
                        {
                            if(dataBuffer[i]>=* a)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 2:
                        {
                            if(dataBuffer[i]<=* a)
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        case 3:
                        {
                            if((dataBuffer[i]>=* a)&&(dataBuffer[i]<=* b))
                                chuancan->lianbiao->append((unsigned long long)pid_p,(void  *)&dataBuffer[i]);
                            break;
                        }
                        }
                        pid_p=(char*)pid_p+sizeof (double);
                    }
                }
                free(dataBuffer);
                break;
            }

            }

            p = (char*)mbi.BaseAddress + mbi.RegionSize;

        }

    }

    //for (LPVOID p = (LPVOID)0x00000000; p < (LPVOID)0x7FFFFFFFFFF;)

    CloseHandle(handleexe);
    //emit saomiaoend();
    //sasomiaotheard::quit();
}

void sasomiaotheard::zaicisaomiao(void * chuancan1)//再次扫描目标  有问题10.2
{
    sendercanshu * chuancan =(sendercanshu *) chuancan1;

    HANDLE handleexe = OpenProcess(PROCESS_ALL_ACCESS, FALSE,chuancan->processID);

    if (handleexe == NULL) {
        std::cerr << "OpenProcess failed: " << GetLastError() << std::endl;
        return ;
    }


    int size_du;
    switch (chuancan->xuhao) {
    case 0:
        size_du = 4;//4字节
        break;
    case 1:
        size_du = 1;//单字节
        break;
    case 2:
        size_du = 2;//2字节
        break;
    case 3:
        size_du = 8;//8字节
        break;
    case 4:
        size_du = 4;//单浮点
        break;
    case 5:
        size_du = 8;//双浮点
        break;
    case 6:
        size_du = 4;//字符串
        break;
    }

    Node* ahead =(Node*) chuancan->lianbiao->returnhead();
    BOOL pid_bol;
    unsigned long long date=0;

    while (ahead!=nullptr) {
        pid_bol = ReadProcessMemory(handleexe, (LPVOID)ahead->dizhiaddress, &date, size_du, NULL);
        //std::cout<<chuancan->jiancha<<std::endl;
        switch (chuancan->guize)
        {
        case 0:
        {
            //std::cout<<chuancan->jiancha<<std::endl;
            if(date==chuancan->jiancha){

                //std::cout<<date<<std::endl;
                ahead->value =  date;
                ahead = ahead->next;
            }else {

                Node *ahead1 = ahead->next;
                chuancan->lianbiao->shanchu((void *)ahead);
                ahead = ahead1;
            }
            break;
        }
        case 1:
        {
            if(date>=chuancan->jiancha)
            {
                ahead->value =  date;
                ahead = ahead->next;
            }else {
                Node *ahead1 = ahead->next;
                chuancan->lianbiao->shanchu((void *)ahead);
                ahead = ahead1;
            }
            break;
        }
        case 2:
        {
            if(date<=chuancan->jiancha)
            {
                ahead->value =  date;
                ahead = ahead->next;
            }else {
                Node *ahead1 = ahead->next;
                chuancan->lianbiao->shanchu((void *)ahead);
                ahead = ahead1;
            }
            break;
        }
        case 3:
        {
            if((date>=chuancan->jiancha)&&(date<=chuancan->jiancha2))
            {
                ahead->value =  date;
                ahead = ahead->next;
            }else {
                Node *ahead1 = ahead->next;
                chuancan->lianbiao->shanchu((void *)ahead);
                ahead = ahead1;
            }
            break;
        }
        }
    }

    //std::cout<<"chuancan->jiancha"<<std::endl;
    CloseHandle(handleexe);
}

